// --------------------------------------------------------------------------------------------------------------------
// <copyright file="FrameworkEntities.generated.cs" company="Open Trader">
//   Copyright (c) David Denis (david.denis@systemathics.com)
// </copyright>
// <summary>
//   |  Open Trader - The Open Source Systematic Trading Platform
//   |
//   |  This program is free software: you can redistribute it and/or modify
//   |  it under the terms of the GNU General Public License as published by
//   |  the Free Software Foundation, either version 2 of the License, or
//   |  (at your option) any later version.
//   |
//   |  This program is distributed in the hope that it will be useful,
//   |  but WITHOUT ANY WARRANTY; without even the implied warranty of
//   |  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   |  GNU General Public License for more details.
//   |
//   |  You should have received a copy of the GNU General Public License
//   |  along with this program.  If not, see http://www.gnu.org/licenses
//   |
//   |  Up to date informations about Open Trader can be found at :
//   |    http://opentrader.org
//   |    http://opentrader.codeplex.com
//   |
//   |  For professional services, please visit us at :
//   |    http://www.systemathics.com
// </summary>
// --------------------------------------------------------------------------------------------------------------------

#region

using System.Data.Mapping;

using Edm_EntityMappingGeneratedViews;

#endregion

[assembly: EntityViewGeneration(typeof(ViewsForBaseEntitySetsA6CD4F9F93050D9B79970DEE83B8BE49))]

namespace Edm_EntityMappingGeneratedViews
{
    #region

    using System;
    using System.Collections.Generic;
    using System.Data.Mapping;

    #endregion

    /// <summary>
    /// The views for base entity sets a 6 c d 4 f 9 f 93050 d 9 b 79970 de e 83 b 8 b e 49.
    /// </summary>
    /// <Summary>
    /// The type contains views for EntitySets and AssociationSets that were generated at design time.
    /// </Summary>
    public sealed class ViewsForBaseEntitySetsA6CD4F9F93050D9B79970DEE83B8BE49 : EntityViewContainer
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ViewsForBaseEntitySetsA6CD4F9F93050D9B79970DEE83B8BE49"/> class. 
        /// The views for base entity sets a 6 c d 4 f 9 f 93050 d 9 b 79970 de e 83 b 8 b e 49.
        /// </summary>
        /// <Summary>
        /// The constructor stores the views for the extents and also the hash values generated based on the metadata and mapping closure and views
        /// </Summary>
        public ViewsForBaseEntitySetsA6CD4F9F93050D9B79970DEE83B8BE49()
        {
            this.EdmEntityContainerName = "OpenTrader_FrameworkEntities";
            this.StoreEntityContainerName = "OpenTrader_FrameworkModelStoreContainer";
            this.HashOverMappingClosure = "7faf850d4d14b10626d0fc5dcb122e4c";
            this.HashOverAllExtentViews = "896b5fc4fb22726d80c6b0871b8fcaaa";
            this.ViewCount = 26;
        }

        #endregion

        // The method returns the view for the index given.
        #region Methods

        /// <summary>
        /// The get view at.
        /// </summary>
        /// <param name="index">
        /// The index.
        /// </param>
        /// <returns>
        /// </returns>
        /// <exception cref="IndexOutOfRangeException">
        /// </exception>
        protected override KeyValuePair<string, string> GetViewAt(int index)
        {
            if (index == 0)
            {
                // return view for OpenTrader_FrameworkModelStoreContainer.DBConfiguration
                return new KeyValuePair<string, string>(
                    "OpenTrader_FrameworkModelStoreContainer.DBConfiguration", 
                    @"
    SELECT VALUE -- Constructing DBConfiguration
        [OpenTrader_FrameworkModel.Store].DBConfiguration(T1.DBConfiguration_ID, T1.[DBConfiguration._InsertionStamp], T1.[DBConfiguration._UpdateStamp])
    FROM (
        SELECT 
            T.ID AS DBConfiguration_ID, 
            T.C_InsertionStamp AS [DBConfiguration._InsertionStamp], 
            T.C_UpdateStamp AS [DBConfiguration._UpdateStamp], 
            True AS _from0
        FROM OpenTrader_FrameworkEntities.DBConfiguration AS T
    ) AS T1");
            }
            else
            {
                if ((index == 1))
                {
                    // return view for OpenTrader_FrameworkModelStoreContainer.DBConfigurationField
                    return
                        new KeyValuePair<string, string>(
                            "OpenTrader_FrameworkModelStoreContainer.DBConfigurationField", 
                            @"
    SELECT VALUE -- Constructing DBConfigurationField
        [OpenTrader_FrameworkModel.Store].DBConfigurationField(T3.DBConfigurationField_ID, T3.DBConfigurationField_DBConfigurationID, T3.DBConfigurationField_Name, T3.DBConfigurationField_Data, T3.[DBConfigurationField._InsertionStamp], T3.[DBConfigurationField._UpdateStamp])
    FROM (
        SELECT T1.DBConfigurationField_ID, T1.DBConfigurationField_DBConfigurationID, T2.DBConfigurationField_Name, T2.DBConfigurationField_Data, T2.[DBConfigurationField._InsertionStamp], T2.[DBConfigurationField._UpdateStamp], T2._from0, T1._from1
        FROM  (
            SELECT 
                Key(T.DBConfigurationField).ID AS DBConfigurationField_ID, 
                Key(T.DBConfiguration).ID AS DBConfigurationField_DBConfigurationID, 
                True AS _from1
            FROM OpenTrader_FrameworkEntities.FK__DBConfigu__DBCon__22AA2996 AS T) AS T1
            INNER JOIN (
            SELECT 
                T.ID AS DBConfigurationField_ID, 
                T.Name AS DBConfigurationField_Name, 
                T.Data AS DBConfigurationField_Data, 
                T.C_InsertionStamp AS [DBConfigurationField._InsertionStamp], 
                T.C_UpdateStamp AS [DBConfigurationField._UpdateStamp], 
                True AS _from0
            FROM OpenTrader_FrameworkEntities.DBConfigurationField AS T) AS T2
            ON T1.DBConfigurationField_ID = T2.DBConfigurationField_ID
    ) AS T3");
                }
                else
                {
                    if ((index == 2))
                    {
                        // return view for OpenTrader_FrameworkModelStoreContainer.DBConfigurationFieldBinaryContents
                        return
                            new KeyValuePair<string, string>(
                                "OpenTrader_FrameworkModelStoreContainer.DBConfigurationFieldBinaryContents", 
                                "\r\n    SELECT VALUE -- Constructing DBConfigurationFieldBinaryContents\r\n        [O" +
                                "penTrader_FrameworkModel.Store].DBConfigurationFieldBinaryContents(T3.DBConfigur" +
                                "ationFieldBinaryContents_ID, T3.DBConfigurationFieldBinaryContents_DBConfigurati" +
                                "onFieldID, T3.DBConfigurationFieldBinaryContents_Name, T3.DBConfigurationFieldBi" +
                                "naryContents_BinaryData, T3.DBConfigurationFieldBinaryContents_TimeStamp, T3.[DB" +
                                "ConfigurationFieldBinaryContents._InsertionStamp], T3.[DBConfigurationFieldBinar" +
                                "yContents._UpdateStamp])\r\n    FROM (\r\n        SELECT T1.DBConfigurationFieldBina" +
                                "ryContents_ID, T1.DBConfigurationFieldBinaryContents_DBConfigurationFieldID, T2." +
                                "DBConfigurationFieldBinaryContents_Name, T2.DBConfigurationFieldBinaryContents_B" +
                                "inaryData, T2.DBConfigurationFieldBinaryContents_TimeStamp, T2.[DBConfigurationF" +
                                "ieldBinaryContents._InsertionStamp], T2.[DBConfigurationFieldBinaryContents._Upd" +
                                "ateStamp], T2._from0, T1._from1\r\n        FROM  (\r\n            SELECT \r\n         " +
                                "       Key(T.DBConfigurationFieldBinaryContents).ID AS DBConfigurationFieldBinar" +
                                "yContents_ID, \r\n                Key(T.DBConfigurationField).ID AS DBConfiguratio" +
                                "nFieldBinaryContents_DBConfigurationFieldID, \r\n                True AS _from1\r\n " +
                                "           FROM OpenTrader_FrameworkEntities.FK__DBConfigu__DBCon__239E4DCF AS T" +
                                ") AS T1\r\n            INNER JOIN (\r\n            SELECT \r\n                T.ID AS " +
                                "DBConfigurationFieldBinaryContents_ID, \r\n                T.Name AS DBConfigurati" +
                                "onFieldBinaryContents_Name, \r\n                T.BinaryData AS DBConfigurationFie" +
                                "ldBinaryContents_BinaryData, \r\n                T.TimeStamp AS DBConfigurationFie" +
                                "ldBinaryContents_TimeStamp, \r\n                T.C_InsertionStamp AS [DBConfigura" +
                                "tionFieldBinaryContents._InsertionStamp], \r\n                T.C_UpdateStamp AS [" +
                                "DBConfigurationFieldBinaryContents._UpdateStamp], \r\n                True AS _fro" +
                                "m0\r\n            FROM OpenTrader_FrameworkEntities.DBConfigurationFieldBinaryCont" +
                                "ents AS T) AS T2\r\n            ON T1.DBConfigurationFieldBinaryContents_ID = T2.D" +
                                "BConfigurationFieldBinaryContents_ID\r\n    ) AS T3");
                    }
                    else
                    {
                        if ((index == 3))
                        {
                            // return view for OpenTrader_FrameworkEntities.DBConfiguration
                            return new KeyValuePair<string, string>(
                                "OpenTrader_FrameworkEntities.DBConfiguration", 
                                @"
    SELECT VALUE -- Constructing DBConfiguration
        OpenTrader_FrameworkModel.DBConfiguration(T1.DBConfiguration_ID, T1.[DBConfiguration.C_InsertionStamp], T1.[DBConfiguration.C_UpdateStamp])
    FROM (
        SELECT 
            T.ID AS DBConfiguration_ID, 
            T._InsertionStamp AS [DBConfiguration.C_InsertionStamp], 
            T._UpdateStamp AS [DBConfiguration.C_UpdateStamp], 
            True AS _from0
        FROM OpenTrader_FrameworkModelStoreContainer.DBConfiguration AS T
    ) AS T1");
                        }
                        else
                        {
                            if ((index == 4))
                            {
                                // return view for OpenTrader_FrameworkEntities.DBConfigurationField
                                return
                                    new KeyValuePair<string, string>(
                                        "OpenTrader_FrameworkEntities.DBConfigurationField", 
                                        @"
    SELECT VALUE -- Constructing DBConfigurationField
        OpenTrader_FrameworkModel.DBConfigurationField(T1.DBConfigurationField_ID, T1.DBConfigurationField_Name, T1.DBConfigurationField_Data, T1.[DBConfigurationField.C_InsertionStamp], T1.[DBConfigurationField.C_UpdateStamp]) WITH 
        RELATIONSHIP(CREATEREF(OpenTrader_FrameworkEntities.DBConfiguration, ROW(T1.[FK__DBConfigu__DBCon__22AA2996.DBConfiguration.ID]),OpenTrader_FrameworkModel.DBConfiguration),OpenTrader_FrameworkModel.FK__DBConfigu__DBCon__22AA2996,DBConfigurationField,DBConfiguration) 
    FROM (
        SELECT 
            T.ID AS DBConfigurationField_ID, 
            T.Name AS DBConfigurationField_Name, 
            T.Data AS DBConfigurationField_Data, 
            T._InsertionStamp AS [DBConfigurationField.C_InsertionStamp], 
            T._UpdateStamp AS [DBConfigurationField.C_UpdateStamp], 
            True AS _from0, 
            T.DBConfigurationID AS [FK__DBConfigu__DBCon__22AA2996.DBConfiguration.ID]
        FROM OpenTrader_FrameworkModelStoreContainer.DBConfigurationField AS T
    ) AS T1");
                            }
                            else
                            {
                                if ((index == 5))
                                {
                                    // return view for OpenTrader_FrameworkEntities.DBConfigurationFieldBinaryContents
                                    return
                                        new KeyValuePair<string, string>(
                                            "OpenTrader_FrameworkEntities.DBConfigurationFieldBinaryContents", 
                                            @"
    SELECT VALUE -- Constructing DBConfigurationFieldBinaryContents
        OpenTrader_FrameworkModel.DBConfigurationFieldBinaryContents(T1.DBConfigurationFieldBinaryContents_ID, T1.DBConfigurationFieldBinaryContents_Name, T1.DBConfigurationFieldBinaryContents_BinaryData, T1.DBConfigurationFieldBinaryContents_TimeStamp, T1.[DBConfigurationFieldBinaryContents.C_InsertionStamp], T1.[DBConfigurationFieldBinaryContents.C_UpdateStamp]) WITH 
        RELATIONSHIP(CREATEREF(OpenTrader_FrameworkEntities.DBConfigurationField, ROW(T1.[FK__DBConfigu__DBCon__239E4DCF.DBConfigurationField.ID]),OpenTrader_FrameworkModel.DBConfigurationField),OpenTrader_FrameworkModel.FK__DBConfigu__DBCon__239E4DCF,DBConfigurationFieldBinaryContents,DBConfigurationField) 
    FROM (
        SELECT 
            T.ID AS DBConfigurationFieldBinaryContents_ID, 
            T.Name AS DBConfigurationFieldBinaryContents_Name, 
            T.BinaryData AS DBConfigurationFieldBinaryContents_BinaryData, 
            T.TimeStamp AS DBConfigurationFieldBinaryContents_TimeStamp, 
            T._InsertionStamp AS [DBConfigurationFieldBinaryContents.C_InsertionStamp], 
            T._UpdateStamp AS [DBConfigurationFieldBinaryContents.C_UpdateStamp], 
            True AS _from0, 
            T.DBConfigurationFieldID AS [FK__DBConfigu__DBCon__239E4DCF.DBConfigurationField.ID]
        FROM OpenTrader_FrameworkModelStoreContainer.DBConfigurationFieldBinaryContents AS T
    ) AS T1");
                                }
                                else
                                {
                                    if ((index == 6))
                                    {
                                        // return view for OpenTrader_FrameworkEntities.FK__DBConfigu__DBCon__22AA2996
                                        return
                                            new KeyValuePair<string, string>(
                                                "OpenTrader_FrameworkEntities.FK__DBConfigu__DBCon__22AA2996", 
                                                @"
    SELECT VALUE -- Constructing FK__DBConfigu__DBCon__22AA2996
        OpenTrader_FrameworkModel.FK__DBConfigu__DBCon__22AA2996(T3.[FK__DBConfigu__DBCon__22AA2996.DBConfiguration], T3.[FK__DBConfigu__DBCon__22AA2996.DBConfigurationField])
    FROM (
        SELECT -- Constructing DBConfiguration
            CreateRef(OpenTrader_FrameworkEntities.DBConfiguration, row(T2.[FK__DBConfigu__DBCon__22AA2996.DBConfiguration.ID]),OpenTrader_FrameworkModel.DBConfiguration) AS [FK__DBConfigu__DBCon__22AA2996.DBConfiguration], 
            T2.[FK__DBConfigu__DBCon__22AA2996.DBConfigurationField]
        FROM (
            SELECT -- Constructing DBConfigurationField
                CreateRef(OpenTrader_FrameworkEntities.DBConfigurationField, row(T1.[FK__DBConfigu__DBCon__22AA2996.DBConfigurationField.ID]),OpenTrader_FrameworkModel.DBConfigurationField) AS [FK__DBConfigu__DBCon__22AA2996.DBConfigurationField], 
                T1.[FK__DBConfigu__DBCon__22AA2996.DBConfiguration.ID]
            FROM (
                SELECT 
                    T.DBConfigurationID AS [FK__DBConfigu__DBCon__22AA2996.DBConfiguration.ID], 
                    T.ID AS [FK__DBConfigu__DBCon__22AA2996.DBConfigurationField.ID], 
                    True AS _from0
                FROM OpenTrader_FrameworkModelStoreContainer.DBConfigurationField AS T
            ) AS T1
        ) AS T2
    ) AS T3");
                                    }
                                    else
                                    {
                                        if ((index == 7))
                                        {
                                            // return view for OpenTrader_FrameworkEntities.FK__DBConfigu__DBCon__239E4DCF
                                            return
                                                new KeyValuePair<string, string>(
                                                    "OpenTrader_FrameworkEntities.FK__DBConfigu__DBCon__239E4DCF", 
                                                    "\r\n    SELECT VALUE -- Constructing FK__DBConfigu__DBCon__239E4DCF\r\n        OpenTr" +
                                                    "ader_FrameworkModel.FK__DBConfigu__DBCon__239E4DCF(T3.[FK__DBConfigu__DBCon__239" +
                                                    "E4DCF.DBConfigurationField], T3.[FK__DBConfigu__DBCon__239E4DCF.DBConfigurationF" +
                                                    "ieldBinaryContents])\r\n    FROM (\r\n        SELECT -- Constructing DBConfiguration" +
                                                    "Field\r\n            CreateRef(OpenTrader_FrameworkEntities.DBConfigurationField, " +
                                                    "row(T2.[FK__DBConfigu__DBCon__239E4DCF.DBConfigurationField.ID]),OpenTrader_Fram" +
                                                    "eworkModel.DBConfigurationField) AS [FK__DBConfigu__DBCon__239E4DCF.DBConfigurat" +
                                                    "ionField], \r\n            T2.[FK__DBConfigu__DBCon__239E4DCF.DBConfigurationField" +
                                                    "BinaryContents]\r\n        FROM (\r\n            SELECT -- Constructing DBConfigurat" +
                                                    "ionFieldBinaryContents\r\n                CreateRef(OpenTrader_FrameworkEntities.D" +
                                                    "BConfigurationFieldBinaryContents, row(T1.[FK__DBConfigu__DBCon__239E4DCF.DBConf" +
                                                    "igurationFieldBinaryContents.ID]),OpenTrader_FrameworkModel.DBConfigurationField" +
                                                    "BinaryContents) AS [FK__DBConfigu__DBCon__239E4DCF.DBConfigurationFieldBinaryCon" +
                                                    "tents], \r\n                T1.[FK__DBConfigu__DBCon__239E4DCF.DBConfigurationFiel" +
                                                    "d.ID]\r\n            FROM (\r\n                SELECT \r\n                    T.DBConf" +
                                                    "igurationFieldID AS [FK__DBConfigu__DBCon__239E4DCF.DBConfigurationField.ID], \r\n" +
                                                    "                    T.ID AS [FK__DBConfigu__DBCon__239E4DCF.DBConfigurationField" +
                                                    "BinaryContents.ID], \r\n                    True AS _from0\r\n                FROM O" +
                                                    "penTrader_FrameworkModelStoreContainer.DBConfigurationFieldBinaryContents AS T\r\n" +
                                                    "            ) AS T1\r\n        ) AS T2\r\n    ) AS T3");
                                        }
                                        else
                                        {
                                            if ((index == 8))
                                            {
                                                // return view for OpenTrader_FrameworkModelStoreContainer.DBContainer
                                                return
                                                    new KeyValuePair<string, string>(
                                                        "OpenTrader_FrameworkModelStoreContainer.DBContainer", 
                                                        @"
    SELECT VALUE -- Constructing DBContainer
        [OpenTrader_FrameworkModel.Store].DBContainer(T3.DBContainer_ID, T3.DBContainer_DBExecutionContextID, T3.DBContainer_Name, T3.DBContainer_IsStrong, T3.[DBContainer._InsertionStamp], T3.[DBContainer._UpdateStamp])
    FROM (
        SELECT T1.DBContainer_ID, T1.DBContainer_DBExecutionContextID, T2.DBContainer_Name, T2.DBContainer_IsStrong, T2.[DBContainer._InsertionStamp], T2.[DBContainer._UpdateStamp], T2._from0, T1._from1
        FROM  (
            SELECT 
                Key(T.DBContainer).ID AS DBContainer_ID, 
                Key(T.DBExecutionContext).ID AS DBContainer_DBExecutionContextID, 
                True AS _from1
            FROM OpenTrader_FrameworkEntities.FK__DBContain__DBExe__24927208 AS T) AS T1
            INNER JOIN (
            SELECT 
                T.ID AS DBContainer_ID, 
                T.Name AS DBContainer_Name, 
                T.IsStrong AS DBContainer_IsStrong, 
                T.C_InsertionStamp AS [DBContainer._InsertionStamp], 
                T.C_UpdateStamp AS [DBContainer._UpdateStamp], 
                True AS _from0
            FROM OpenTrader_FrameworkEntities.DBContainer AS T) AS T2
            ON T1.DBContainer_ID = T2.DBContainer_ID
    ) AS T3");
                                            }
                                            else
                                            {
                                                if ((index == 9))
                                                {
                                                    // return view for OpenTrader_FrameworkModelStoreContainer.DBContainerResource
                                                    return
                                                        new KeyValuePair<string, string>(
                                                            "OpenTrader_FrameworkModelStoreContainer.DBContainerResource", 
                                                            "\r\n    SELECT VALUE -- Constructing DBContainerResource\r\n        [OpenTrader_Frame" +
                                                            "workModel.Store].DBContainerResource(T4.DBContainerResource_ID, T4.DBContainerRe" +
                                                            "source_DBContainerID, T4.DBContainerResource_DBResourceID, T4.[DBContainerResour" +
                                                            "ce._InsertionStamp], T4.[DBContainerResource._UpdateStamp])\r\n    FROM (\r\n       " +
                                                            " SELECT T1.DBContainerResource_ID, T2.DBContainerResource_DBContainerID, T1.DBCo" +
                                                            "ntainerResource_DBResourceID, T3.[DBContainerResource._InsertionStamp], T3.[DBCo" +
                                                            "ntainerResource._UpdateStamp], T3._from0, T2._from1, T1._from2\r\n        FROM  (\r" +
                                                            "\n            SELECT \r\n                Key(T.DBContainerResource).ID AS DBContain" +
                                                            "erResource_ID, \r\n                Key(T.DBResource).ID AS DBContainerResource_DBR" +
                                                            "esourceID, \r\n                True AS _from2\r\n            FROM OpenTrader_Framewo" +
                                                            "rkEntities.FK__DBContain__DBRes__267ABA7A AS T) AS T1\r\n            INNER JOIN (\r" +
                                                            "\n            SELECT \r\n                Key(T.DBContainerResource).ID AS DBContain" +
                                                            "erResource_ID, \r\n                Key(T.DBContainer).ID AS DBContainerResource_DB" +
                                                            "ContainerID, \r\n                True AS _from1\r\n            FROM OpenTrader_Frame" +
                                                            "workEntities.FK__DBContain__DBCon__25869641 AS T) AS T2\r\n            ON T1.DBCon" +
                                                            "tainerResource_ID = T2.DBContainerResource_ID\r\n            INNER JOIN (\r\n       " +
                                                            "     SELECT \r\n                T.ID AS DBContainerResource_ID, \r\n                " +
                                                            "T.C_InsertionStamp AS [DBContainerResource._InsertionStamp], \r\n                T" +
                                                            ".C_UpdateStamp AS [DBContainerResource._UpdateStamp], \r\n                True AS " +
                                                            "_from0\r\n            FROM OpenTrader_FrameworkEntities.DBContainerResource AS T) " +
                                                            "AS T3\r\n            ON T1.DBContainerResource_ID = T3.DBContainerResource_ID\r\n   " +
                                                            " ) AS T4");
                                                }
                                                else
                                                {
                                                    if ((index == 10))
                                                    {
                                                        // return view for OpenTrader_FrameworkModelStoreContainer.DBExecutionContext
                                                        return
                                                            new KeyValuePair<string, string>(
                                                                "OpenTrader_FrameworkModelStoreContainer.DBExecutionContext", 
                                                                @"
    SELECT VALUE -- Constructing DBExecutionContext
        [OpenTrader_FrameworkModel.Store].DBExecutionContext(T1.DBExecutionContext_ID, T1.DBExecutionContext_Name, T1.[DBExecutionContext._InsertionStamp], T1.[DBExecutionContext._UpdateStamp])
    FROM (
        SELECT 
            T.ID AS DBExecutionContext_ID, 
            T.Name AS DBExecutionContext_Name, 
            T.C_InsertionStamp AS [DBExecutionContext._InsertionStamp], 
            T.C_UpdateStamp AS [DBExecutionContext._UpdateStamp], 
            True AS _from0
        FROM OpenTrader_FrameworkEntities.DBExecutionContext AS T
    ) AS T1");
                                                    }
                                                    else
                                                    {
                                                        if ((index == 11))
                                                        {
                                                            // return view for OpenTrader_FrameworkModelStoreContainer.DBLiveObject
                                                            return
                                                                new KeyValuePair<string, string>(
                                                                    "OpenTrader_FrameworkModelStoreContainer.DBLiveObject", 
                                                                    "\r\n    SELECT VALUE -- Constructing DBLiveObject\r\n        [OpenTrader_FrameworkMod" +
                                                                    "el.Store].DBLiveObject(T4.DBLiveObject_ID, T4.DBLiveObject_DBConfigurationID, T4" +
                                                                    ".DBLiveObject_DBParentID, T4.DBLiveObject_DBExecutionContextID, T4.DBLiveObject_" +
                                                                    "Type, T4.DBLiveObject_InterfaceFullTypeName, T4.DBLiveObject_Label, T4.DBLiveObj" +
                                                                    "ect_ServicePluginInterfaceTypeName, T4.DBLiveObject_ListenURL, T4.DBLiveObject_N" +
                                                                    "ame, T4.DBLiveObject_Location, T4.DBLiveObject_DBContainerID, T4.DBLiveObject_Cl" +
                                                                    "assFullTypeName, T4.DBLiveObject_ConfigurationSchemaClassName, T4.DBLiveObject_U" +
                                                                    "RL, T4.[DBLiveObject._InsertionStamp], T4.[DBLiveObject._UpdateStamp])\r\n    FROM" +
                                                                    " (\r\n        SELECT T1.DBLiveObject_ID, T1.DBLiveObject_DBConfigurationID, T3.DBL" +
                                                                    "iveObject_DBParentID, T1.DBLiveObject_DBExecutionContextID, T1.DBLiveObject_Type" +
                                                                    ", T1.DBLiveObject_InterfaceFullTypeName, T1.DBLiveObject_Label, T1.DBLiveObject_" +
                                                                    "ServicePluginInterfaceTypeName, T1.DBLiveObject_ListenURL, T1.DBLiveObject_Name," +
                                                                    " T1.DBLiveObject_Location, T2.DBLiveObject_DBContainerID, T1.DBLiveObject_ClassF" +
                                                                    "ullTypeName, T1.DBLiveObject_ConfigurationSchemaClassName, T1.DBLiveObject_URL, " +
                                                                    "T1.[DBLiveObject._InsertionStamp], T1.[DBLiveObject._UpdateStamp], T1._from0, (T" +
                                                                    "2._from1 AND T2._from1 IS NOT NULL) AS _from1, (T3._from2 AND T3._from2 IS NOT N" +
                                                                    "ULL) AS _from2\r\n        FROM  (\r\n            SELECT \r\n                T.ID AS DB" +
                                                                    "LiveObject_ID, \r\n                T.DBConfigurationID AS DBLiveObject_DBConfigura" +
                                                                    "tionID, \r\n                T.DBExecutionContextID AS DBLiveObject_DBExecutionCont" +
                                                                    "extID, \r\n                T.Type AS DBLiveObject_Type, \r\n                T.Interf" +
                                                                    "aceFullTypeName AS DBLiveObject_InterfaceFullTypeName, \r\n                T.Label" +
                                                                    " AS DBLiveObject_Label, \r\n                T.ServicePluginInterfaceTypeName AS DB" +
                                                                    "LiveObject_ServicePluginInterfaceTypeName, \r\n                T.ListenURL AS DBLi" +
                                                                    "veObject_ListenURL, \r\n                T.Name AS DBLiveObject_Name, \r\n           " +
                                                                    "     T.Location AS DBLiveObject_Location, \r\n                T.ClassFullTypeName " +
                                                                    "AS DBLiveObject_ClassFullTypeName, \r\n                T.ConfigurationSchemaClassN" +
                                                                    "ame AS DBLiveObject_ConfigurationSchemaClassName, \r\n                T.URL AS DBL" +
                                                                    "iveObject_URL, \r\n                T.C_InsertionStamp AS [DBLiveObject._InsertionS" +
                                                                    "tamp], \r\n                T.C_UpdateStamp AS [DBLiveObject._UpdateStamp], \r\n     " +
                                                                    "           True AS _from0\r\n            FROM OpenTrader_FrameworkEntities.DBLiveO" +
                                                                    "bject AS T) AS T1\r\n            LEFT OUTER JOIN (\r\n            SELECT \r\n         " +
                                                                    "       Key(T.DBLiveObject).ID AS DBLiveObject_ID, \r\n                Key(T.DBCont" +
                                                                    "ainer).ID AS DBLiveObject_DBContainerID, \r\n                True AS _from1\r\n     " +
                                                                    "       FROM OpenTrader_FrameworkEntities.FK__DBLiveObj__DBCon__29572725 AS T) AS" +
                                                                    " T2\r\n            ON T1.DBLiveObject_ID = T2.DBLiveObject_ID\r\n            LEFT OU" +
                                                                    "TER JOIN (\r\n            SELECT \r\n                Key(T.DBLiveObject1).ID AS DBLi" +
                                                                    "veObject_ID, \r\n                Key(T.DBLiveObject).ID AS DBLiveObject_DBParentID" +
                                                                    ", \r\n                True AS _from2\r\n            FROM OpenTrader_FrameworkEntitie" +
                                                                    "s.FK__DBLiveObj__DBPar__286302EC AS T) AS T3\r\n            ON T1.DBLiveObject_ID " +
                                                                    "= T3.DBLiveObject_ID\r\n    ) AS T4");
                                                        }
                                                        else
                                                        {
                                                            if ((index == 12))
                                                            {
                                                                // return view for OpenTrader_FrameworkModelStoreContainer.DBResource
                                                                return
                                                                    new KeyValuePair<string, string>(
                                                                        "OpenTrader_FrameworkModelStoreContainer.DBResource", 
                                                                        @"
    SELECT VALUE -- Constructing DBResource
        [OpenTrader_FrameworkModel.Store].DBResource(T1.DBResource_ID, T1.DBResource_Directory, T1.DBResource_Name, T1.DBResource_Extension, T1.DBResource_Content, T1.DBResource_TimeStamp, T1.DBResource_IsAssembly, T1.[DBResource._InsertionStamp], T1.[DBResource._UpdateStamp])
    FROM (
        SELECT 
            T.ID AS DBResource_ID, 
            T.Directory AS DBResource_Directory, 
            T.Name AS DBResource_Name, 
            T.Extension AS DBResource_Extension, 
            T.Content AS DBResource_Content, 
            T.TimeStamp AS DBResource_TimeStamp, 
            T.IsAssembly AS DBResource_IsAssembly, 
            T.C_InsertionStamp AS [DBResource._InsertionStamp], 
            T.C_UpdateStamp AS [DBResource._UpdateStamp], 
            True AS _from0
        FROM OpenTrader_FrameworkEntities.DBResource AS T
    ) AS T1");
                                                            }
                                                            else
                                                            {
                                                                if ((index == 13))
                                                                {
                                                                    // return view for OpenTrader_FrameworkEntities.DBContainer
                                                                    return
                                                                        new KeyValuePair<string, string>(
                                                                            "OpenTrader_FrameworkEntities.DBContainer", 
                                                                            @"
    SELECT VALUE -- Constructing DBContainer
        OpenTrader_FrameworkModel.DBContainer(T1.DBContainer_ID, T1.DBContainer_Name, T1.DBContainer_IsStrong, T1.[DBContainer.C_InsertionStamp], T1.[DBContainer.C_UpdateStamp]) WITH 
        RELATIONSHIP(CREATEREF(OpenTrader_FrameworkEntities.DBExecutionContext, ROW(T1.[FK__DBContain__DBExe__24927208.DBExecutionContext.ID]),OpenTrader_FrameworkModel.DBExecutionContext),OpenTrader_FrameworkModel.FK__DBContain__DBExe__24927208,DBContainer,DBExecutionContext) 
    FROM (
        SELECT 
            T.ID AS DBContainer_ID, 
            T.Name AS DBContainer_Name, 
            T.IsStrong AS DBContainer_IsStrong, 
            T._InsertionStamp AS [DBContainer.C_InsertionStamp], 
            T._UpdateStamp AS [DBContainer.C_UpdateStamp], 
            True AS _from0, 
            T.DBExecutionContextID AS [FK__DBContain__DBExe__24927208.DBExecutionContext.ID]
        FROM OpenTrader_FrameworkModelStoreContainer.DBContainer AS T
    ) AS T1");
                                                                }
                                                                else
                                                                {
                                                                    if ((index == 14))
                                                                    {
                                                                        // return view for OpenTrader_FrameworkEntities.DBContainerResource
                                                                        return
                                                                            new KeyValuePair<string, string>(
                                                                                "OpenTrader_FrameworkEntities.DBContainerResource", 
                                                                                @"
    SELECT VALUE -- Constructing DBContainerResource
        OpenTrader_FrameworkModel.DBContainerResource(T1.DBContainerResource_ID, T1.[DBContainerResource.C_InsertionStamp], T1.[DBContainerResource.C_UpdateStamp]) WITH 
        RELATIONSHIP(CREATEREF(OpenTrader_FrameworkEntities.DBContainer, ROW(T1.[FK__DBContain__DBCon__25869641.DBContainer.ID]),OpenTrader_FrameworkModel.DBContainer),OpenTrader_FrameworkModel.FK__DBContain__DBCon__25869641,DBContainerResource,DBContainer) 
        RELATIONSHIP(CREATEREF(OpenTrader_FrameworkEntities.DBResource, ROW(T1.[FK__DBContain__DBRes__267ABA7A.DBResource.ID]),OpenTrader_FrameworkModel.DBResource),OpenTrader_FrameworkModel.FK__DBContain__DBRes__267ABA7A,DBContainerResource,DBResource) 
    FROM (
        SELECT 
            T.ID AS DBContainerResource_ID, 
            T._InsertionStamp AS [DBContainerResource.C_InsertionStamp], 
            T._UpdateStamp AS [DBContainerResource.C_UpdateStamp], 
            True AS _from0, 
            T.DBContainerID AS [FK__DBContain__DBCon__25869641.DBContainer.ID], 
            T.DBResourceID AS [FK__DBContain__DBRes__267ABA7A.DBResource.ID]
        FROM OpenTrader_FrameworkModelStoreContainer.DBContainerResource AS T
    ) AS T1");
                                                                    }
                                                                    else
                                                                    {
                                                                        if ((index == 15))
                                                                        {
                                                                            // return view for OpenTrader_FrameworkEntities.DBExecutionContext
                                                                            return
                                                                                new KeyValuePair<string, string>(
                                                                                    "OpenTrader_FrameworkEntities.DBExecutionContext", 
                                                                                    @"
    SELECT VALUE -- Constructing DBExecutionContext
        OpenTrader_FrameworkModel.DBExecutionContext(T1.DBExecutionContext_ID, T1.DBExecutionContext_Name, T1.[DBExecutionContext.C_InsertionStamp], T1.[DBExecutionContext.C_UpdateStamp])
    FROM (
        SELECT 
            T.ID AS DBExecutionContext_ID, 
            T.Name AS DBExecutionContext_Name, 
            T._InsertionStamp AS [DBExecutionContext.C_InsertionStamp], 
            T._UpdateStamp AS [DBExecutionContext.C_UpdateStamp], 
            True AS _from0
        FROM OpenTrader_FrameworkModelStoreContainer.DBExecutionContext AS T
    ) AS T1");
                                                                        }
                                                                        else
                                                                        {
                                                                            if ((index == 16))
                                                                            {
                                                                                // return view for OpenTrader_FrameworkEntities.DBLiveObject
                                                                                return
                                                                                    new KeyValuePair<string, string>(
                                                                                        "OpenTrader_FrameworkEntities.DBLiveObject", 
                                                                                        "\r\n    SELECT VALUE -- Constructing DBLiveObject\r\n        OpenTrader_FrameworkMode" +
                                                                                        "l.DBLiveObject(T1.DBLiveObject_ID, T1.DBLiveObject_DBConfigurationID, T1.DBLiveO" +
                                                                                        "bject_DBExecutionContextID, T1.DBLiveObject_Type, T1.DBLiveObject_InterfaceFullT" +
                                                                                        "ypeName, T1.DBLiveObject_Label, T1.DBLiveObject_ServicePluginInterfaceTypeName, " +
                                                                                        "T1.DBLiveObject_ListenURL, T1.DBLiveObject_Name, T1.DBLiveObject_Location, T1.DB" +
                                                                                        "LiveObject_ClassFullTypeName, T1.DBLiveObject_ConfigurationSchemaClassName, T1.D" +
                                                                                        "BLiveObject_URL, T1.[DBLiveObject.C_InsertionStamp], T1.[DBLiveObject.C_UpdateSt" +
                                                                                        "amp]) WITH \r\n        RELATIONSHIP(CREATEREF(OpenTrader_FrameworkEntities.DBConta" +
                                                                                        "iner, ROW(T1.[FK__DBLiveObj__DBCon__29572725.DBContainer.ID]),OpenTrader_Framewo" +
                                                                                        "rkModel.DBContainer),OpenTrader_FrameworkModel.FK__DBLiveObj__DBCon__29572725,DB" +
                                                                                        "LiveObject,DBContainer) \r\n        RELATIONSHIP(CREATEREF(OpenTrader_FrameworkEnt" +
                                                                                        "ities.DBLiveObject, ROW(T1.[FK__DBLiveObj__DBPar__286302EC.DBLiveObject.ID]),Ope" +
                                                                                        "nTrader_FrameworkModel.DBLiveObject),OpenTrader_FrameworkModel.FK__DBLiveObj__DB" +
                                                                                        "Par__286302EC,DBLiveObject1,DBLiveObject) \r\n    FROM (\r\n        SELECT \r\n       " +
                                                                                        "     T.ID AS DBLiveObject_ID, \r\n            T.DBConfigurationID AS DBLiveObject_" +
                                                                                        "DBConfigurationID, \r\n            T.DBExecutionContextID AS DBLiveObject_DBExecut" +
                                                                                        "ionContextID, \r\n            T.Type AS DBLiveObject_Type, \r\n            T.Interfa" +
                                                                                        "ceFullTypeName AS DBLiveObject_InterfaceFullTypeName, \r\n            T.Label AS D" +
                                                                                        "BLiveObject_Label, \r\n            T.ServicePluginInterfaceTypeName AS DBLiveObjec" +
                                                                                        "t_ServicePluginInterfaceTypeName, \r\n            T.ListenURL AS DBLiveObject_List" +
                                                                                        "enURL, \r\n            T.Name AS DBLiveObject_Name, \r\n            T.Location AS DB" +
                                                                                        "LiveObject_Location, \r\n            T.ClassFullTypeName AS DBLiveObject_ClassFull" +
                                                                                        "TypeName, \r\n            T.ConfigurationSchemaClassName AS DBLiveObject_Configura" +
                                                                                        "tionSchemaClassName, \r\n            T.URL AS DBLiveObject_URL, \r\n            T._I" +
                                                                                        "nsertionStamp AS [DBLiveObject.C_InsertionStamp], \r\n            T._UpdateStamp A" +
                                                                                        "S [DBLiveObject.C_UpdateStamp], \r\n            True AS _from0, \r\n            T.DB" +
                                                                                        "ContainerID AS [FK__DBLiveObj__DBCon__29572725.DBContainer.ID], \r\n            T." +
                                                                                        "DBParentID AS [FK__DBLiveObj__DBPar__286302EC.DBLiveObject.ID]\r\n        FROM Ope" +
                                                                                        "nTrader_FrameworkModelStoreContainer.DBLiveObject AS T\r\n    ) AS T1");
                                                                            }
                                                                            else
                                                                            {
                                                                                if ((index == 17))
                                                                                {
                                                                                    // return view for OpenTrader_FrameworkEntities.DBResource
                                                                                    return
                                                                                        new KeyValuePair<string, string>
                                                                                            (
                                                                                            "OpenTrader_FrameworkEntities.DBResource", 
                                                                                            @"
    SELECT VALUE -- Constructing DBResource
        OpenTrader_FrameworkModel.DBResource(T1.DBResource_ID, T1.DBResource_Directory, T1.DBResource_Name, T1.DBResource_Extension, T1.DBResource_Content, T1.DBResource_TimeStamp, T1.DBResource_IsAssembly, T1.[DBResource.C_InsertionStamp], T1.[DBResource.C_UpdateStamp])
    FROM (
        SELECT 
            T.ID AS DBResource_ID, 
            T.Directory AS DBResource_Directory, 
            T.Name AS DBResource_Name, 
            T.Extension AS DBResource_Extension, 
            T.Content AS DBResource_Content, 
            T.TimeStamp AS DBResource_TimeStamp, 
            T.IsAssembly AS DBResource_IsAssembly, 
            T._InsertionStamp AS [DBResource.C_InsertionStamp], 
            T._UpdateStamp AS [DBResource.C_UpdateStamp], 
            True AS _from0
        FROM OpenTrader_FrameworkModelStoreContainer.DBResource AS T
    ) AS T1");
                                                                                }
                                                                                else
                                                                                {
                                                                                    if ((index == 18))
                                                                                    {
                                                                                        // return view for OpenTrader_FrameworkEntities.FK__DBContain__DBCon__25869641
                                                                                        return
                                                                                            new KeyValuePair
                                                                                                <string, string>(
                                                                                                "OpenTrader_FrameworkEntities.FK__DBContain__DBCon__25869641", 
                                                                                                @"
    SELECT VALUE -- Constructing FK__DBContain__DBCon__25869641
        OpenTrader_FrameworkModel.FK__DBContain__DBCon__25869641(T3.[FK__DBContain__DBCon__25869641.DBContainer], T3.[FK__DBContain__DBCon__25869641.DBContainerResource])
    FROM (
        SELECT -- Constructing DBContainer
            CreateRef(OpenTrader_FrameworkEntities.DBContainer, row(T2.[FK__DBContain__DBCon__25869641.DBContainer.ID]),OpenTrader_FrameworkModel.DBContainer) AS [FK__DBContain__DBCon__25869641.DBContainer], 
            T2.[FK__DBContain__DBCon__25869641.DBContainerResource]
        FROM (
            SELECT -- Constructing DBContainerResource
                CreateRef(OpenTrader_FrameworkEntities.DBContainerResource, row(T1.[FK__DBContain__DBCon__25869641.DBContainerResource.ID]),OpenTrader_FrameworkModel.DBContainerResource) AS [FK__DBContain__DBCon__25869641.DBContainerResource], 
                T1.[FK__DBContain__DBCon__25869641.DBContainer.ID]
            FROM (
                SELECT 
                    T.DBContainerID AS [FK__DBContain__DBCon__25869641.DBContainer.ID], 
                    T.ID AS [FK__DBContain__DBCon__25869641.DBContainerResource.ID], 
                    True AS _from0
                FROM OpenTrader_FrameworkModelStoreContainer.DBContainerResource AS T
            ) AS T1
        ) AS T2
    ) AS T3");
                                                                                    }
                                                                                    else
                                                                                    {
                                                                                        if ((index == 19))
                                                                                        {
                                                                                            // return view for OpenTrader_FrameworkEntities.FK__DBContain__DBExe__24927208
                                                                                            return
                                                                                                new KeyValuePair
                                                                                                    <string, string>(
                                                                                                    "OpenTrader_FrameworkEntities.FK__DBContain__DBExe__24927208", 
                                                                                                    @"
    SELECT VALUE -- Constructing FK__DBContain__DBExe__24927208
        OpenTrader_FrameworkModel.FK__DBContain__DBExe__24927208(T3.[FK__DBContain__DBExe__24927208.DBExecutionContext], T3.[FK__DBContain__DBExe__24927208.DBContainer])
    FROM (
        SELECT -- Constructing DBExecutionContext
            CreateRef(OpenTrader_FrameworkEntities.DBExecutionContext, row(T2.[FK__DBContain__DBExe__24927208.DBExecutionContext.ID]),OpenTrader_FrameworkModel.DBExecutionContext) AS [FK__DBContain__DBExe__24927208.DBExecutionContext], 
            T2.[FK__DBContain__DBExe__24927208.DBContainer]
        FROM (
            SELECT -- Constructing DBContainer
                CreateRef(OpenTrader_FrameworkEntities.DBContainer, row(T1.[FK__DBContain__DBExe__24927208.DBContainer.ID]),OpenTrader_FrameworkModel.DBContainer) AS [FK__DBContain__DBExe__24927208.DBContainer], 
                T1.[FK__DBContain__DBExe__24927208.DBExecutionContext.ID]
            FROM (
                SELECT 
                    T.DBExecutionContextID AS [FK__DBContain__DBExe__24927208.DBExecutionContext.ID], 
                    T.ID AS [FK__DBContain__DBExe__24927208.DBContainer.ID], 
                    True AS _from0
                FROM OpenTrader_FrameworkModelStoreContainer.DBContainer AS T
            ) AS T1
        ) AS T2
    ) AS T3");
                                                                                        }
                                                                                        else
                                                                                        {
                                                                                            if ((index == 20))
                                                                                            {
                                                                                                // return view for OpenTrader_FrameworkEntities.FK__DBLiveObj__DBCon__29572725
                                                                                                return
                                                                                                    new KeyValuePair
                                                                                                        <string, string>
                                                                                                        (
                                                                                                        "OpenTrader_FrameworkEntities.FK__DBLiveObj__DBCon__29572725", 
                                                                                                        @"
    SELECT VALUE -- Constructing FK__DBLiveObj__DBCon__29572725
        OpenTrader_FrameworkModel.FK__DBLiveObj__DBCon__29572725(T3.[FK__DBLiveObj__DBCon__29572725.DBContainer], T3.[FK__DBLiveObj__DBCon__29572725.DBLiveObject])
    FROM (
        SELECT -- Constructing DBContainer
            CreateRef(OpenTrader_FrameworkEntities.DBContainer, row(T2.[FK__DBLiveObj__DBCon__29572725.DBContainer.ID]),OpenTrader_FrameworkModel.DBContainer) AS [FK__DBLiveObj__DBCon__29572725.DBContainer], 
            T2.[FK__DBLiveObj__DBCon__29572725.DBLiveObject]
        FROM (
            SELECT -- Constructing DBLiveObject
                CreateRef(OpenTrader_FrameworkEntities.DBLiveObject, row(T1.[FK__DBLiveObj__DBCon__29572725.DBLiveObject.ID]),OpenTrader_FrameworkModel.DBLiveObject) AS [FK__DBLiveObj__DBCon__29572725.DBLiveObject], 
                T1.[FK__DBLiveObj__DBCon__29572725.DBContainer.ID]
            FROM (
                SELECT 
                    T.DBContainerID AS [FK__DBLiveObj__DBCon__29572725.DBContainer.ID], 
                    T.ID AS [FK__DBLiveObj__DBCon__29572725.DBLiveObject.ID], 
                    True AS _from0
                FROM OpenTrader_FrameworkModelStoreContainer.DBLiveObject AS T
                WHERE T.DBContainerID IS NOT NULL
            ) AS T1
        ) AS T2
    ) AS T3");
                                                                                            }
                                                                                            else
                                                                                            {
                                                                                                if ((index == 21))
                                                                                                {
                                                                                                    // return view for OpenTrader_FrameworkEntities.FK__DBContain__DBRes__267ABA7A
                                                                                                    return
                                                                                                        new KeyValuePair
                                                                                                            <string, 
                                                                                                                string>(
                                                                                                            "OpenTrader_FrameworkEntities.FK__DBContain__DBRes__267ABA7A", 
                                                                                                            @"
    SELECT VALUE -- Constructing FK__DBContain__DBRes__267ABA7A
        OpenTrader_FrameworkModel.FK__DBContain__DBRes__267ABA7A(T3.[FK__DBContain__DBRes__267ABA7A.DBResource], T3.[FK__DBContain__DBRes__267ABA7A.DBContainerResource])
    FROM (
        SELECT -- Constructing DBResource
            CreateRef(OpenTrader_FrameworkEntities.DBResource, row(T2.[FK__DBContain__DBRes__267ABA7A.DBResource.ID]),OpenTrader_FrameworkModel.DBResource) AS [FK__DBContain__DBRes__267ABA7A.DBResource], 
            T2.[FK__DBContain__DBRes__267ABA7A.DBContainerResource]
        FROM (
            SELECT -- Constructing DBContainerResource
                CreateRef(OpenTrader_FrameworkEntities.DBContainerResource, row(T1.[FK__DBContain__DBRes__267ABA7A.DBContainerResource.ID]),OpenTrader_FrameworkModel.DBContainerResource) AS [FK__DBContain__DBRes__267ABA7A.DBContainerResource], 
                T1.[FK__DBContain__DBRes__267ABA7A.DBResource.ID]
            FROM (
                SELECT 
                    T.DBResourceID AS [FK__DBContain__DBRes__267ABA7A.DBResource.ID], 
                    T.ID AS [FK__DBContain__DBRes__267ABA7A.DBContainerResource.ID], 
                    True AS _from0
                FROM OpenTrader_FrameworkModelStoreContainer.DBContainerResource AS T
            ) AS T1
        ) AS T2
    ) AS T3");
                                                                                                }
                                                                                                else
                                                                                                {
                                                                                                    if ((index == 22))
                                                                                                    {
                                                                                                        // return view for OpenTrader_FrameworkEntities.FK__DBLiveObj__DBPar__286302EC
                                                                                                        return
                                                                                                            new KeyValuePair
                                                                                                                <string, 
                                                                                                                    string
                                                                                                                    >(
                                                                                                                "OpenTrader_FrameworkEntities.FK__DBLiveObj__DBPar__286302EC", 
                                                                                                                @"
    SELECT VALUE -- Constructing FK__DBLiveObj__DBPar__286302EC
        OpenTrader_FrameworkModel.FK__DBLiveObj__DBPar__286302EC(T3.[FK__DBLiveObj__DBPar__286302EC.DBLiveObject], T3.[FK__DBLiveObj__DBPar__286302EC.DBLiveObject1])
    FROM (
        SELECT -- Constructing DBLiveObject
            CreateRef(OpenTrader_FrameworkEntities.DBLiveObject, row(T2.[FK__DBLiveObj__DBPar__286302EC.DBLiveObject.ID]),OpenTrader_FrameworkModel.DBLiveObject) AS [FK__DBLiveObj__DBPar__286302EC.DBLiveObject], 
            T2.[FK__DBLiveObj__DBPar__286302EC.DBLiveObject1]
        FROM (
            SELECT -- Constructing DBLiveObject1
                CreateRef(OpenTrader_FrameworkEntities.DBLiveObject, row(T1.[FK__DBLiveObj__DBPar__286302EC.DBLiveObject1.ID]),OpenTrader_FrameworkModel.DBLiveObject) AS [FK__DBLiveObj__DBPar__286302EC.DBLiveObject1], 
                T1.[FK__DBLiveObj__DBPar__286302EC.DBLiveObject.ID]
            FROM (
                SELECT 
                    T.DBParentID AS [FK__DBLiveObj__DBPar__286302EC.DBLiveObject.ID], 
                    T.ID AS [FK__DBLiveObj__DBPar__286302EC.DBLiveObject1.ID], 
                    True AS _from0
                FROM OpenTrader_FrameworkModelStoreContainer.DBLiveObject AS T
                WHERE T.DBParentID IS NOT NULL
            ) AS T1
        ) AS T2
    ) AS T3");
                                                                                                    }
                                                                                                    else
                                                                                                    {
                                                                                                        if ((index == 23))
                                                                                                        {
                                                                                                            // return view for OpenTrader_FrameworkModelStoreContainer.DBExecutionContextINode
                                                                                                            return
                                                                                                                new KeyValuePair
                                                                                                                    <
                                                                                                                        string
                                                                                                                        , 
                                                                                                                        string
                                                                                                                        >
                                                                                                                    (
                                                                                                                    "OpenTrader_FrameworkModelStoreContainer.DBExecutionContextINode", 
                                                                                                                    "\r\n    SELECT VALUE -- Constructing DBExecutionContextINode\r\n        [OpenTrader_F" +
                                                                                                                    "rameworkModel.Store].DBExecutionContextINode(T3.DBExecutionContextINode_ID, T3.D" +
                                                                                                                    "BExecutionContextINode_DBExecutionContextID, T3.DBExecutionContextINode_DBParent" +
                                                                                                                    "ExecutionContextINodeID, T3.DBExecutionContextINode_Path, T3.DBExecutionContextI" +
                                                                                                                    "Node_FullPath, T3.[DBExecutionContextINode._InsertionStamp], T3.[DBExecutionCont" +
                                                                                                                    "extINode._UpdateStamp])\r\n    FROM (\r\n        SELECT T1.DBExecutionContextINode_I" +
                                                                                                                    "D, T2.DBExecutionContextINode_DBExecutionContextID, T1.DBExecutionContextINode_D" +
                                                                                                                    "BParentExecutionContextINodeID, T2.DBExecutionContextINode_Path, T2.DBExecutionC" +
                                                                                                                    "ontextINode_FullPath, T2.[DBExecutionContextINode._InsertionStamp], T2.[DBExecut" +
                                                                                                                    "ionContextINode._UpdateStamp], T2._from0, T1._from1\r\n        FROM  (\r\n          " +
                                                                                                                    "  SELECT \r\n                Key(T.DBExecutionContextINode1).ID AS DBExecutionCont" +
                                                                                                                    "extINode_ID, \r\n                Key(T.DBExecutionContextINode).ID AS DBExecutionC" +
                                                                                                                    "ontextINode_DBParentExecutionContextINodeID, \r\n                True AS _from1\r\n " +
                                                                                                                    "           FROM OpenTrader_FrameworkEntities.FK__DBExecuti__DBPar__47DBAE45 AS T" +
                                                                                                                    ") AS T1\r\n            INNER JOIN (\r\n            SELECT \r\n                T.ID AS " +
                                                                                                                    "DBExecutionContextINode_ID, \r\n                T.DBExecutionContextID AS DBExecut" +
                                                                                                                    "ionContextINode_DBExecutionContextID, \r\n                T.Path AS DBExecutionCon" +
                                                                                                                    "textINode_Path, \r\n                T.FullPath AS DBExecutionContextINode_FullPath" +
                                                                                                                    ", \r\n                T.C_InsertionStamp AS [DBExecutionContextINode._InsertionSta" +
                                                                                                                    "mp], \r\n                T.C_UpdateStamp AS [DBExecutionContextINode._UpdateStamp]" +
                                                                                                                    ", \r\n                True AS _from0\r\n            FROM OpenTrader_FrameworkEntitie" +
                                                                                                                    "s.DBExecutionContextINode AS T) AS T2\r\n            ON T1.DBExecutionContextINode" +
                                                                                                                    "_ID = T2.DBExecutionContextINode_ID\r\n    ) AS T3");
                                                                                                        }
                                                                                                        else
                                                                                                        {
                                                                                                            if (
                                                                                                                (index ==
                                                                                                                 24))
                                                                                                            {
                                                                                                                // return view for OpenTrader_FrameworkEntities.DBExecutionContextINode
                                                                                                                return
                                                                                                                    new KeyValuePair
                                                                                                                        <
                                                                                                                            string
                                                                                                                            , 
                                                                                                                            string
                                                                                                                            >
                                                                                                                        (
                                                                                                                        "OpenTrader_FrameworkEntities.DBExecutionContextINode", 
                                                                                                                        @"
    SELECT VALUE -- Constructing DBExecutionContextINode
        OpenTrader_FrameworkModel.DBExecutionContextINode(T1.DBExecutionContextINode_ID, T1.DBExecutionContextINode_DBExecutionContextID, T1.DBExecutionContextINode_Path, T1.DBExecutionContextINode_FullPath, T1.[DBExecutionContextINode.C_InsertionStamp], T1.[DBExecutionContextINode.C_UpdateStamp]) WITH 
        RELATIONSHIP(CREATEREF(OpenTrader_FrameworkEntities.DBExecutionContextINode, ROW(T1.[FK__DBExecuti__DBPar__47DBAE45.DBExecutionContextINode.ID]),OpenTrader_FrameworkModel.DBExecutionContextINode),OpenTrader_FrameworkModel.FK__DBExecuti__DBPar__47DBAE45,DBExecutionContextINode1,DBExecutionContextINode) 
    FROM (
        SELECT 
            T.ID AS DBExecutionContextINode_ID, 
            T.DBExecutionContextID AS DBExecutionContextINode_DBExecutionContextID, 
            T.Path AS DBExecutionContextINode_Path, 
            T.FullPath AS DBExecutionContextINode_FullPath, 
            T._InsertionStamp AS [DBExecutionContextINode.C_InsertionStamp], 
            T._UpdateStamp AS [DBExecutionContextINode.C_UpdateStamp], 
            True AS _from0, 
            T.DBParentExecutionContextINodeID AS [FK__DBExecuti__DBPar__47DBAE45.DBExecutionContextINode.ID]
        FROM OpenTrader_FrameworkModelStoreContainer.DBExecutionContextINode AS T
    ) AS T1");
                                                                                                            }
                                                                                                            else
                                                                                                            {
                                                                                                                if (
                                                                                                                    (index ==
                                                                                                                     25))
                                                                                                                {
                                                                                                                    // return view for OpenTrader_FrameworkEntities.FK__DBExecuti__DBPar__47DBAE45
                                                                                                                    return
                                                                                                                        new KeyValuePair
                                                                                                                            <
                                                                                                                                string
                                                                                                                                , 
                                                                                                                                string
                                                                                                                                >
                                                                                                                            (
                                                                                                                            "OpenTrader_FrameworkEntities.FK__DBExecuti__DBPar__47DBAE45", 
                                                                                                                            "\r\n    SELECT VALUE -- Constructing FK__DBExecuti__DBPar__47DBAE45\r\n        OpenTr" +
                                                                                                                            "ader_FrameworkModel.FK__DBExecuti__DBPar__47DBAE45(T3.[FK__DBExecuti__DBPar__47D" +
                                                                                                                            "BAE45.DBExecutionContextINode], T3.[FK__DBExecuti__DBPar__47DBAE45.DBExecutionCo" +
                                                                                                                            "ntextINode1])\r\n    FROM (\r\n        SELECT -- Constructing DBExecutionContextINod" +
                                                                                                                            "e\r\n            CreateRef(OpenTrader_FrameworkEntities.DBExecutionContextINode, r" +
                                                                                                                            "ow(T2.[FK__DBExecuti__DBPar__47DBAE45.DBExecutionContextINode.ID]),OpenTrader_Fr" +
                                                                                                                            "ameworkModel.DBExecutionContextINode) AS [FK__DBExecuti__DBPar__47DBAE45.DBExecu" +
                                                                                                                            "tionContextINode], \r\n            T2.[FK__DBExecuti__DBPar__47DBAE45.DBExecutionC" +
                                                                                                                            "ontextINode1]\r\n        FROM (\r\n            SELECT -- Constructing DBExecutionCon" +
                                                                                                                            "textINode1\r\n                CreateRef(OpenTrader_FrameworkEntities.DBExecutionCo" +
                                                                                                                            "ntextINode, row(T1.[FK__DBExecuti__DBPar__47DBAE45.DBExecutionContextINode1.ID])" +
                                                                                                                            ",OpenTrader_FrameworkModel.DBExecutionContextINode) AS [FK__DBExecuti__DBPar__47" +
                                                                                                                            "DBAE45.DBExecutionContextINode1], \r\n                T1.[FK__DBExecuti__DBPar__47" +
                                                                                                                            "DBAE45.DBExecutionContextINode.ID]\r\n            FROM (\r\n                SELECT \r" +
                                                                                                                            "\n                    T.DBParentExecutionContextINodeID AS [FK__DBExecuti__DBPar_" +
                                                                                                                            "_47DBAE45.DBExecutionContextINode.ID], \r\n                    T.ID AS [FK__DBExec" +
                                                                                                                            "uti__DBPar__47DBAE45.DBExecutionContextINode1.ID], \r\n                    True AS" +
                                                                                                                            " _from0\r\n                FROM OpenTrader_FrameworkModelStoreContainer.DBExecutio" +
                                                                                                                            "nContextINode AS T\r\n            ) AS T1\r\n        ) AS T2\r\n    ) AS T3");
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            throw new IndexOutOfRangeException();
        }

        #endregion
    }
}